package com.bt.lms.ui.action.teaching.plan;


import com.alibaba.fastjson.JSON;
import com.bt.lms.ui.action.teaching.plan.utils.ConvertReqMsgPacket;
import com.bt.lms.ui.action.teaching.plan.utils.GetNet;
import com.bt.lms.ui.action.teaching.plan.utils.HandleTowReqMsgPacket;
import com.bt.lms.network.msg.ReqMsg;
import com.bt.lms.network.msg.packet.ReqMsgPacket;
import com.bt.lms.ui.page.common.action.pageteaching.TeachingPlanLabAction;
import com.bt.lms.ui.page.teaching.plan.PageTeachingPlanBasicInfoList;
import com.bt.lms.ui.page.teaching.plan.PageViewDetailsTeachingPlan;
import com.bt.lms.ui.page.teaching.plan.vo.AddTeachingSetVo;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.layout.Pane;

import java.net.Socket;

/**
 * 教学计划
 * 查看教学计划详情事件
 */
public class LTeachingPlanViewDetailsAction implements EventHandler {




    @Override
    public void handle(Event event) {

        //获取用户输入
        LSetTeachingPlanSaveBtnAction lSetTeachingPlanSaveBtnAction = new LSetTeachingPlanSaveBtnAction();
        AddTeachingSetVo inParams = lSetTeachingPlanSaveBtnAction.getInParams();
        String string = JSON.toJSONString(inParams);
        //组包
        short a = 1001;//数据类型
        //请求消息
        ReqMsg reqMsg = ConvertReqMsgPacket.convertReqMsgPacket(string, a);
        //请求消息包
        ReqMsgPacket reqMsgPacket = HandleTowReqMsgPacket.handle2ReqMsgPacket(reqMsg);
        //组网
        Socket socket = GetNet.getNet();
        //发送消息


        PageViewDetailsTeachingPlan pageTeachingPlanViewDetails = new PageViewDetailsTeachingPlan();
        Pane pane = TeachingPlanLabAction.pageSkipInfo.getPane();
        Integer index = TeachingPlanLabAction.pageSkipInfo.getIndex();
        pane.getChildren().set(index,pageTeachingPlanViewDetails);
    }






    }




